home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_c / cuj0696.zip / DWYER.ZIP / SPECTRAL.TST / PRTSPDAT.CX < prev    next >
Text File  |  1996-03-10  |  1KB  |  45 lines

  1. /* ============ */
  2. /* prtspdat.cx    */
  3. /* ============ */
  4. #include <stdio.h>
  5. #include <xtendefs.h>
  6. /* ==================================================================== */
  7. /* PrintSpectralData - Prints Results of Dimension N Spectral Analysis    */
  8. /* ==================================================================== */
  9. void
  10. PrintSprectalData(USHORT * XS, USHORT * XMerit, short N)
  11. {
  12.     static
  13.     USHORT  MustInit = TRUE;
  14.     static
  15.     USHORT  OneHndrth[NE];
  16.     USHORT  Tmp1[NE];
  17.  
  18.     if (MustInit)
  19.     {
  20.     ASCTOX("0.01", OneHndrth);    /* Build 0.01 */
  21.     MustInit = FALSE;
  22.     }
  23.     printf("%2d-Dimensional Accuracy = ", N);
  24.     PutXInt(XS, 21);            /* Fld Width is 21 */
  25.  
  26.     printf(" No. Bits: ");
  27.     XLOG(XS, Tmp1);            /* ln(XS) / ln(2) = lg(XS) */
  28.     XRDIV(Tmp1, ELOG2);
  29.     XRMULT(Tmp1, EHALF);                /* Yields lg(XS^.5) */
  30.     PutXFrac(Tmp1, 1, 0);        /* Puts xx.x */
  31.     printf("\n");
  32.  
  33.     printf("%2d-Dimensional Merit    = ", N);
  34.  
  35.     if (XGTE(XMerit, OneHndrth))
  36.     {
  37.     PutXFrac(XMerit, 2, 21);
  38.     }
  39.     else
  40.     {
  41.     PutXFlt(XMerit, 2, 21);
  42.     }
  43.     printf(" (Good > 0.1, Great > 1.0)\n");
  44. }
  45.